package com.dianwoba.pt.goodjob.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.ServletContextInitializer;
import org.springframework.context.annotation.Configuration;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

/**
 * @author 杨斌冰-工具组-技术中心
 *         <p>
 *         2017/6/13 16:06
 */
@Configuration
public class ServletConfigAdapter implements ServletContextInitializer {

    @Value("${app.servername}")
    private String appServerName;

    @Value("${cas.sever.url}")
    private String casServerUrl;

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        servletContext.setInitParameter("serverName",appServerName);
        servletContext.setInitParameter("casServerUrlPrefix", casServerUrl);
    }
}
